﻿using SqlSugar;

namespace SIS.Infrastructures.Context
{
    public class DbContext : IDbContext
    {
        public DbContext()
        {
            Connection = new SqlSugarClient(new ConnectionConfig()
            {
                ConnectionString = Initialize.ConnectionStringKey,
                DbType = DbType.SqlServer,
                IsAutoCloseConnection = true,
                IsShardSameThread = true //设为true相同线程是同一个SqlConnection
            });
        }

        public SqlSugarClient Connection { get; set; }

    }
}
